﻿<UserControl x:Class="TriviaViews.Views.EntranceView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:converter="clr-namespace:TriviaViews.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="300">

    <UserControl.Resources>
        <Style x:Key="labelStyle" TargetType="Label">

            <Setter Property="FontSize" Value="20"></Setter>
            <Setter Property="FontWeight" Value="Bold"></Setter>

        </Style>


    </UserControl.Resources>
    <UserControl.Background>
        <ImageBrush Opacity="0.6"></ImageBrush>
        <!--<ImageBrush ImageSource="\TriviaViews;component\Images\images.jpg" Opacity="0.6"></ImageBrush>-->
    </UserControl.Background>

    <Grid>
        <StackPanel Grid.Row="0">
            <Grid Visibility="{Binding IsEntryVisible}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition Height="auto"></RowDefinition>

                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"></ColumnDefinition>
                    <ColumnDefinition Width="auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>

                <Label Margin="10" Style="{StaticResource labelStyle}">User Name:</Label>
                <TextBox Margin="10" Text="{Binding UserName}" Grid.Column="1"></TextBox>

                <Label Margin="10"  Style="{StaticResource labelStyle}" Grid.Row="1">Password:</Label>
                <TextBox Margin="10" Grid.Row="1" Grid.Column="1" Text="{Binding Password}"></TextBox>



                <StackPanel Grid.Row="2" Margin="10">
                    <Label  Width="auto"  Style="{StaticResource labelStyle}" Grid.Row="2">Difficulty:</Label>
                    <ListView  ItemsSource="{Binding Difficulties}" SelectedItem="{Binding SelectedDifficulty}" FontSize="20"></ListView>
                </StackPanel>



                <StackPanel Grid.Row="2" Grid.Column="1" Margin="10">
                    <Label Style="{StaticResource labelStyle}"  Width="auto">Topic:</Label>
                    <ListView  ItemsSource="{Binding Topics}" SelectedItem="{Binding SelectedTopic}" FontSize="20"></ListView>
                </StackPanel>
                
                <Button  Command="{Binding GoToGameCommand}" Margin="10" FontSize="15" Grid.Row="3" HorizontalAlignment="Center" Visibility="{Binding IsEntryVisible}" Grid.ColumnSpan="2">Play Game</Button>

            </Grid>
        </StackPanel>
        
        <StackPanel Grid.Row="0" Grid.RowSpan="3"  Visibility="{Binding IsGameVisible}">
            <ContentControl  Content="{Binding GameViewModel}"></ContentControl>
            <Button Command="{Binding EndGameCommand}" Width="auto" HorizontalAlignment="Center" >Exit Game</Button>
        </StackPanel>
        
    </Grid >




</UserControl>
